package com.jhx.service.impl;

import com.github.pagehelper.PageHelper;
import com.jhx.dao.MemberMapper;
import com.jhx.pojo.Member;
import com.jhx.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl implements IMemberService {
    @Autowired
    private MemberMapper memberMapper;
    /*
    * 查询所有
    * */
    @Override
    public List<Member> findMemberAll(String name, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return memberMapper.findMemberAll(name);
    }

    /*
    * 添加
    * */
    @Override
    public int addMember(Member member) {
        return memberMapper.addMember(member);
    }
    /*
    * 删除
    * */
    @Override
    public int deleteMemberById(List<String> id) {


        return memberMapper.deleteMemberById(id);
    }

    /*
    * 根据id查询
    * */
    @Override
    public Member findMemberById(Integer id) {
        return memberMapper.findMemberById(id);
    }

    /*
    * 修改
     */
    @Override
    public int updateMember(Member member) {
        return memberMapper.updateMember(member);
    }

}
